package j27;

/**
 * @author chengshuai
 * @date 2021/4/13 9:28
 *
 * 测试 synchronized可重入锁
 */
public class Test {
    public synchronized void f1() {
        System.out.println(Thread.currentThread().getId()+"====》f1");
        f2();
    }
    public synchronized void f2() {
        System.out.println(Thread.currentThread().getId()+"====》f2");
    }
    public static void main(String[] args) {
        Test test = new Test();
        new Thread(()->{
            test.f1();
        }).start();

        new Thread(()->{
            test.f1();
        }).start();
    }

}
